<div class="boxer"><div class="box">
	<div class="ping-show-box backfff">
		<table border="0" cellspacing="0" cellpadding="0" class="margin_ten">
			<tr>
				<td width="170">举报单号</td>
				<td>{{.Report.Report_num}}</td>
			</tr>
		</table>
		<h2><i></i>举报人信息</h2>
		<table border="0" cellspacing="0" cellpadding="0" class="margin_ten">
			<tr>
				<td width="170">用户昵称</td>
				<td>{{.Report.User_name}}</td>
			</tr>
			<tr>
				<td>手机号</td>
				<td class="tel">{{substr .Report.Phone 0 3}}****{{substr .Report.Phone 8 11}}</td>
			</tr>
			<tr>
				<td>举报通过次数</td>
				<td><em>{{.TCount}}</em>次</td>
			</tr>
			<tr>
				<td>举报拒绝次数</td>
				<td><em>{{.JCount}}</em>次</td>
			</tr>
			<tr>
				<td>举报总次数</td>
				<td><em>{{.Count}}</em>次</td>
			</tr>
		</table>
		<h2 class="margin_ten"><i></i>举报内容</h2>
		<table border="0" cellspacing="0" cellpadding="0" class="margin_ten">
			<tr>
				<td width="170">举报内容</td>
				<td>{{.Report.Report_content}}</td>
			</tr>
			<tr>
				<td>举报描述</td>
				<td>{{.Report.Report_description}}</td>
			</tr>
		</table>
		<h2 class="margin_ten"><i></i>被举报信息</h2>
		<table border="0" cellspacing="0" cellpadding="0" width="95%" class="margin_ten">
			<tr>
				<td width="170">被举报用户昵称</td>
				<td>{{.Report.Be_user_name}}</td>
			</tr>
			<tr>
				<td>被举报用户手机号</td>
				<td class="tel">{{substr .Report.Be_report_phone 0 3}}****{{substr .Report.Be_report_phone 8 11}}</td>
			</tr>
			<tr>
				<td>被举报文章标题</td>
				<td>{{.Report.Article_title}}</td>
			</tr>
			<tr>
				<td>被举报文章地址</td>
				<td><a href="{{.Report.Be_report_address}}">{{.Report.Be_report_address}}</a></td>
			</tr>
			<tr>
				<td>评论内容</td>
				<td>{{.Report.Comment_content}}</td>
			</tr>
			<tr>
				<td>被举报通过次数</td>
				<td><em>{{.BTCount}}</em>次</td>
			</tr>
			<tr>
				<td>被举报拒绝次数</td>
				<td><em>{{.BJCount}}</em>次</td>
			</tr>
			<tr>
				<td>被举报总次数</td>
				<td><em>{{.BCount}}</em>次</td>
			</tr>
			{{if eq .Report.Audit_status 1}}
				<tr>
				<td>审核结果</td>
				<td>
					审核通过
				</td>
			</tr>
			<tr>
				<td>审核意见</td>
				<td>
					{{.Report.Audit_opinion}}
				</td>
			</tr>
				<tr>
				<td colspan="2" class="btn">
					<input type="button" style="background-color:#cccccc" value="取消" onclick="javascript:window.history.back(-1);"/>
				</td>
			</tr>
			{{else if eq .Report.Audit_status 2}}
					<tr>
				<td>审核结果</td>
				<td>
					审核拒绝 (
					{{if eq .Report.Refused_status 1}}
						举报内容不实
					{{else if eq .Report.Refused_status 2}}
						多次举报相同内容
					{{else}}
						其他(手动输入)
					{{end}}
					)
				</td>
			</tr>
			<tr id="jubao-ey-row" class="hid">
				<td>是否恶意举报</td>
				<td><input type="radio" id="jubao-ey-y" class="hid" value="1" name="is_malicious"/><label for="jubao-ey-y" class="selected">是</label><input type="radio" id="jubao-ey-n" class="hid" value="0" name="is_malicious"/><label for="jubao-ey-n">否</label></td>
			</tr>
			<tr>
				<td>审核意见</td>
				<td>
					{{.Report.Audit_opinion}}
				</td>
			</tr>
			<tr>
				<td colspan="2" class="btn">
					<input type="button" style="background-color:#cccccc" value="取消" onclick="javascript:window.history.back(-1);"/>
				</td>
			</tr>
			{{else}}
			<form method="post" action="/report/audit/{{.Report.Id}}" id="shform">
			<tr>
				<td>审核结果</td>
				<td>
					<select name="Audit_status" id="jubao-result">
						<option value="1">审核通过</option>
						<option value="2">审核拒绝</option>
					</select>
					<select name="Refused_status" id="jubao-type">
						<option value="1">举报内容不实</option>
						<option value="2">多次举报相同内容</option>
						<option value="3">其他(手动输入)</option>
					</select>
				</td>
			</tr>
			<tr id="jubao-ey-row" class="hid">
				<td>是否恶意举报</td>
				<td><input type="radio" id="jubao-ey-y" class="hid" value="1" name="is_malicious"/><label for="jubao-ey-y" class="selected">是</label><input type="radio" id="jubao-ey-n" class="hid" value="0" name="is_malicious"/><label for="jubao-ey-n">否</label></td>
			</tr>
			<tr>
				<td valign="top">审核意见</td>
				<td><textarea name="Audit_opinion" id="" rows="3"></textarea></td>
			</tr>
			<tr>
				<td colspan="2" class="btn">
					{{if haspermission $.userId "report:audit"}}
							<input type="button" value="确定" id="submit"/>
					{{end}}
					<input type="button" style="background-color:#cccccc" value="取消" onclick="javascript:window.history.back(-1);"/>
				</td>
			</tr>
			</form>
			{{end}}
		</table>
	</div>
</div></div>
<script type="text/javascript">
jQuery(function($){
	nku.droplist.config({'theme':'win7'}).play('jubao-result');
	nku.droplist.config({'theme':'win7'}).play('jubao-type');
	$("#jubao-type").hide();
	$("#jubao-result").on("click","li",function(){
		if ($(this).attr("v") == 2) {
			$("#jubao-type").show();
			$("#jubao-ey-row").show();
		} else {
			$("#jubao-type").hide();
			$("#jubao-ey-row").hide();
		}
	});

	$("#jubao-ey-row label").on("click",function(){
		$(this).parent().children("label").each(function(){
			if ($(this).attr("class")=="selected") {
				$(this).removeClass();
			} else {
				$(this).addClass("selected");
			}
		});
	});
});
$("#submit").on("click",function(){
	status=$("[name=Audit_status]").val()
	var jj=9
	var eyjb=9
	if (status==2){
		jj=$("[name=Refused_status]").val()
		eyjb=$("[name=is_malicious]:checked").val()
	}
	opinion=$("[name=Audit_opinion]").val()
		$.ajax({
			type: "POST",
			url: $("#shform").attr("action"),
	    	data: {"Audit_status":status,"Refused_status":jj,"is_malicious":eyjb,"Audit_opinion":opinion},
			dataType:'json',
			success: function(data){
				if(data.Code==1){
					window.location.href="/report/list/"+status
				}else{
					alert(data.Message);
				}
				
			}
		});
});
</script>
